package com.icss.OA.controller;

import com.icss.OA.common.R;
import com.icss.OA.pojo.Dept;
import com.icss.OA.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptController {

    @Autowired
    DeptService deptService;

//    @GetMapping
    @RequestMapping(value="allDept.action", method = RequestMethod.GET)
    public R getAllDept() {

        List<Dept> dlist = deptService.findAll();

        return R.success(dlist);
    }
}
